# Contributor: mio <miyopan@e.email>
# Maintainer: mio <miyopan@e.email>
pkgname=ibus-anthy
pkgver=1.5.16
pkgrel=0
pkgdesc="Japanese input method Anthy IMEngine for IBus Framework"
url="https://github.com/ibus/ibus-anthy"
arch="all !s390x" # ibus needs librsvg which isn't available on s390x
license="GPL-2.0-only"
depends="
	ibus
	py3-gobject3
	"
makedepends="
	anthy-dev
	autoconf
	automake
	gobject-introspection-dev
	ibus-dev
	intltool
	m4
	"
checkdepends="
	bash
	libfaketime
	sed
	"
# Patch disables checking for optional checkdepends package not in repos
source="$pkgname-$pkgver.tar.gz::https://github.com/ibus/ibus-anthy/archive/$pkgver.tar.gz
	disable-pycotap.patch
	"
subpackages="$pkgname-lang"

prepare() {
	default_prepare

	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--prefix=/usr \
		--host=$CHOST \
		--build=$CBUILD \
		--libexec=/usr/lib/ibus
	make
}

check() {
	# tests use current date output and need yearly updates
	# they also run rm -r HOME/.config/anthy ...
	HOME="$builddir" \
	faketime '2021-01-01' \
		make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
af782509c3a098864fc0327f0f1226b2f1b9890b36bf69c208ffe977fb07c1f71dea946e8ad4dc9b2cdd6c84252d34a8c8b17f855c6fa7320e3a58b7719e86c5  ibus-anthy-1.5.16.tar.gz
a918038736e6ce4cc8a357c042cb7b4271970ae9e58d855f481c4cc06b436215732e194c700518baaacfa947b34e3ad7172795087d8287319cb0a6a974d25d32  disable-pycotap.patch
"
